<div class='jxd_news yanhx_window' id="{{item.id}}" dataKey='content'>
   <div class="window_tool" >
   		<span class="title">我的短讯</span>
   		<a href="javascript:void(0)" class="ctrl" callfunc="click:closeNews"></a>
   </div>
   <div class='window_content'>
	   <div class="form_list" datakey="content"></div>
	   <div>
	   		共<span id='totalSpan'>0</span>条未读信息
	   		<button class='btn' callFunc='click:qryMoreNews' page="1">更多</button>
	   </div>
   </div>
</div>
<script>
var newsDiv=null;
yanhx.addCommon("load",function(){
	//查询当天未读信息
	newsDiv=$("#jxd_news");
	queryNewsTotal();
	queryNews({page:1,pageSize:10});
	newsDiv.warnPanel();
	newsDiv.show("slow");
});
function queryNewsTotal(){
	$.java({
		action:"main.newsTotal",
		callback:function(data){
			newsDiv.find("#totalSpan").text(data.total);
		}
	});
};
function queryNews(param){
	$.java({
		action:"main.news",
		param:param,
		callback:function(data){
			if(!data.length){
				newsDiv.find("button").removeAttr("page").hide();
				return;
			}
			newsDiv.find("div.form_list").list(data,false,{
				noTitle:true
			});
		}
	});
};
yanhx.addFunc("closeNews",function(){
	$("#jxd_news").remove();
});
yanhx.addFunc("qryMoreNews",function(){
	var p=this.attr("page");
	if(p){
		p=Number(p)+1;
		this.attr("page",p);
		queryNews({page:p,pageSize:10});
	}
});
</script>